import { Map } from "immutable";
import * as types from "./constants";
const initState = Map({
    categories: [],
    currentId: 0,
    recommends: [],
    radios: []
});

function reducer(state = initState, actions) {
    switch (actions.type) {
        case types.CHANGE_CURRENT_ID:
            return state.set("currentId", actions.currentId);
        case types.CHANGE_RADIO_CATEGORY:
            return state.set("categories", actions.categories);
        case types.CHANGE_RECOMMENDS:
            return state.set("recommends", actions.recommends);
        case types.CHANGE_RADIOS:
            return state.set("radios", actions.radios);
        default:
            return state;
    }
}
export default reducer;